package auctionhaus

class EmailService {

	def mailService
	boolean transactional = false

	def sendEmails(List messages) {
		def success = false
		try {
			for (message in messages) {
				mailService.sendMail() {
					to message.getRecipient()
					from message.getSender()
					subject message.getSubject()
					body message.getBody()
				}
			}
		} catch (Exception e) {
			log.error("Failed to send email ", e)
		}
		success = true
		return success
	}
}
